home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Utils / GParted Live CD / Bin / gparted-livecd-0.2.2.iso / usr_sqfs / bin / autopasswd < prev    next >
Encoding:
Text File  |  2005-07-18  |  290 b   |  14 lines

  1. #!/bin/sh
  2. # \
  3. exec expect -f "$0" ${1+"$@"}
  4. # wrapper to make passwd(1) be non-interactive
  5. # username is passed as 1st arg, passwd as 2nd
  6.  
  7. set password [lindex $argv 1]
  8. spawn passwd [lindex $argv 0]
  9. expect "assword:"
  10. send -- "$password\r"
  11. expect "assword:"
  12. send -- "$password\r"
  13. expect eof
  14.